package com.ebt.m.commons.buscomponent.thirtylogin.api;

import okhttp3.ResponseBody;
import retrofit2.Response;
import retrofit2.http.Query;
import retrofit2.http.GET;
import io.reactivex.Observable;

/**
 * Created by andy.wang on 2016/10/31.
 */

public interface WechatApiService {


    /**
     * 通过code获取access_token
     *
     * @return
     */
    @GET("/sns/oauth2/access_token")
    Observable<Response<ResponseBody>> getAccessToken(@Query("appid") String appid, @Query("secret") String secret, @Query("code") String code, @Query("grant_type") String grant_type);


    /**
     * 获取用户个人信息（UnionID机制）
     *
     * @return
     */
    @GET("/sns/userinfo")
    Observable<Response<ResponseBody>> getWechatUserInfo(@Query("access_token") String access_token, @Query("openid") String openid);

}
